-
Notifications
You must be signed in to change notification settings - Fork 56
improvement(build): add -Dlibrary_name for change name *.dll, *.so, *… #157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see the changes to library_name
I mentioned.
@@ -16,6 +16,7 @@ pub fn build(b: *Build) void { | |||
const optimize = b.standardOptimizeOption(.{}); | |||
|
|||
const lang = b.option(Language, "lang", "Lua language version to build") orelse .lua54; | |||
const library_name = b.option([]const u8, "library_name", "Library name for lua linking, default is `lua`") orelse null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the default is lua
, why not do orelse "lua"
? that would allow you to treat library_name
as having type []const u8
instead of ?[]const u8
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair question. I think I tried that and got a compilation error. Maybe you'll come up with a better solution.
@@ -31,6 +32,7 @@ pub fn build(b: *Build) void { | |||
// Expose build configuration to the ziglua module | |||
const config = b.addOptions(); | |||
config.addOption(Language, "lang", lang); | |||
config.addOption(?[]const u8, "library_name", library_name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this necessary? i'm not opposed to it—i just don't see what role this line plays.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope I understood correctly and this is for the output zig build --help
my experience of please feel free to change the code |
Second part resolves #147
This is a prototype. Maybe I did something wrong. Maybe it's worth adding the same functionality to .luajit and .luau